<%@ page import="java.net.URLEncoder" %>
<%@ page import="com.Text1" %><%--
  Created by IntelliJ IDEA.
  User: 范军建
  Date: 2022/3/28
  Time: 16:36
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
</head>
<body>
<%
    request.setCharacterEncoding("utf-8");
    String username=request.getParameter("user");
    String password=request.getParameter("pass");
   if (username.equals("admin")){
       Text1 text1 = new Text1();
       text1.setName(username);
       text1.setPassword(password);
       session.setAttribute("text1" ,text1);
       request.getRequestDispatcher("2.jsp").forward(request,response);
   }else {
       String flag =URLEncoder.encode("定向成功","utf-8");
      /* session.setAttribute("username",username);*/
       /*session.removeAttribute("username");*/
       /*session.setMaxInactiveInterval(3000);*/
        response.sendRedirect(request.getContextPath()+"/1.jsp?info="+flag);
    }
%>

</body>
</html>
